package org.dromara.common.social.topiam

import me.zhyd.oauth.config.AuthSource
import me.zhyd.oauth.request.AuthDefaultRequest

/**
 * Oauth2 默认接口说明
 *
 * @author LikeYouDo
 * @date 2025/07/26
 */
enum class AuthTopIamSource : AuthSource {
    /**
     * 测试
     */
    TOPIAM {
        /**
         * 授权的api
         */
        override fun authorize(): String {
            return AuthTopIamRequest.SERVER_URL + "/oauth2/auth"
        }

        /**
         * 获取accessToken的api
         */
        override fun accessToken(): String {
            return AuthTopIamRequest.SERVER_URL + "/oauth2/token"
        }

        /**
         * 获取用户信息的api
         */
        override fun userInfo(): String {
            return AuthTopIamRequest.SERVER_URL + "/oauth2/userinfo"
        }

        /**
         * 平台对应的 AuthRequest 实现类，必须继承自 [AuthDefaultRequest]
         */
        override fun getTargetClass(): Class<out AuthDefaultRequest> {
            return AuthTopIamRequest::class.java
        }

    }
}
